import {Loading} from 'element-ui';

let loading;

export default {
    show(msg) {
        loading = Loading.service({
            lock: true,
            text: msg || '加载中',
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)'
        });
        return loading
    },
    close() {
        if (loading) {
            loading.close();
        }
    }
}